scale: Properly update when inverted
authorTimm Bäder <mail@baedert.org>
Fri, 9 Aug 2019 17:36:01 +0000 (19:36 +0200)
committerTimm Bäder <mail@baedert.org>
Sat, 10 Aug 2019 17:51:45 +0000 (19:51 +0200)
Just queue_resize()ing the range itself doesn't work as it will just
re-allocate all the child widgets (i.e. just the trough) to its old
position and size.

gtk/gtkrange.c
gtk/gtkscale.c

index d8532ca289c66478e9f5f9d923c8d831514a0394..0dffe25dabf4ec4d6482abb75d8fb0b76c3e2b00 100644 (file)
@@ -781,7 +781,7 @@ gtk_range_set_inverted (GtkRange *range,
       update_fill_position (range);
       update_highlight_position (range);
 
-      gtk_widget_queue_resize (GTK_WIDGET (range));
+      gtk_widget_queue_resize (priv->trough_widget);
 
       g_object_notify_by_pspec (G_OBJECT (range), properties[PROP_INVERTED]);
     }
index 538b86ac599ba780aba7550275d3a9b2ecfb017d..c7922e859173b34d8ec78d4a9bd2819bf80b1d48 100644 (file)
@@ -304,6 +304,12 @@ gtk_scale_notify (GObject    *object,
 
       _gtk_range_set_stop_values (GTK_RANGE (scale), values, n);
 
+      if (priv->top_marks_widget)
+        gtk_widget_queue_resize (priv->top_marks_widget);
+
+      if (priv->bottom_marks_widget)
+        gtk_widget_queue_resize (priv->bottom_marks_widget);
+
       g_free (values);
     }
   else if (strcmp (pspec->name, "adjustment"))